home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / dbpcxl15.zip / VESA.H < prev    next >
C/C++ Source or Header  |  1992-01-26  |  4KB  |  132 lines

  1. /* vesa.h */
  2. #ifndef __VESALIB__
  3. #define __VESALIB__
  4.  
  5. #ifndef __VIDLIB__
  6.       unsigned int  _screen_width;
  7.       unsigned int  _screen_length;
  8.       char *_screen_start;
  9. #endif
  10.  
  11. struct    vesainfo {
  12.     char    signature[4];   /* shoud be "VESA" */
  13.         int     version;
  14.     char *OEMinfo;
  15.     char    capabilities[4];
  16.     int *modeptr;
  17.     char    Reserved[246];
  18. };
  19.  
  20.  
  21. struct    vesamodeinfo {
  22.     int    modeattr;
  23.     char    WindowAattr;
  24.     char    WindowBattr;
  25.     int    granularity;
  26.     int    size;
  27.     int    Asegment;
  28.     int    Bsegment;
  29.     void    (*Windowsetptr)();
  30.     int    bytesperline;
  31.  
  32.     /* optional information (when bit 1 of modeattr is set)    */
  33.  
  34.     int    XPixels;
  35.     int    YPixels;
  36.     char    charwidth;
  37.     char    charlength;
  38.     char    planes;
  39.     char    bits;
  40.     char    banks;
  41.     char    memorymodel;
  42.     char    banksize;               /* in k bytes */
  43.     char    Reserved[246];
  44. };
  45.  
  46. #ifdef VESA
  47. struct          vesainfo   Vinfo;
  48. struct      vesamodeinfo   Vminfo;
  49.             unsigned int   vesapage=0;
  50.         unsigned int   Vnext_break_row;
  51.         unsigned int   Vnext_break_col;
  52.         unsigned long  _window_size;
  53. #else
  54. extern   struct vesainfo   Vinfo;
  55. extern struct vesamodeinfo Vminfo;
  56. extern        unsigned int vesapage;
  57. extern        unsigned int Vnext_break_row;
  58. extern        unsigned int Vnext_break_col;
  59. extern       unsigned long _window_size;
  60. #endif
  61.  
  62. /* included for compatibility with previous version of this library */
  63. #define VESAfirst_page(r,c)     (VESAwhat_page(r,c))
  64. #define VESApage_offset(r,c)    (VESAwhat_offset(r,c))
  65. #define Vnext_break        (Vnext_break_row)
  66. #define Vnext_break_offset    (Vnext_break_offset)
  67.  
  68. #define Vabsolute_offset(r,c) \
  69.  (((long)(r)*(long)Vminfo.bytesperline)+(c))
  70. #define VESAwhat_page(r,c)   \
  71.  ((unsigned int)(Vabsolute_offset(r,c)/_window_size))
  72. #define VESAwhat_offset(r,c) \
  73.  ((unsigned int)(Vabsolute_offset(r,c)%_window_size))
  74.  
  75.  
  76. /* If compiling under TurboC++, make sure it knows how to link. */
  77. #ifdef _cplusplus
  78. extern "C" {
  79. #endif
  80.  
  81. int              VESAmode(unsigned int mode, char *palette);
  82. int              isVESA(void);           /* 1=VESA ok., 0=no VESA */
  83. int              isVESAmode(int mode);   /* see if a VESA mode is valid */
  84. struct vesainfo *getVESAinfo(int mode);
  85.  
  86. void             VESAnext_break(void);
  87. /* used by setpages to set Vnext_break_row and Vnext_break_col variables */
  88.  
  89. int              VESAsetpage(unsigned page);
  90. int              VESAsetpagew(char window, unsigned page);
  91. int              VESAsetpagewbios(char window, unsigned page);
  92.  
  93. int              VESAfill256(unsigned dx, unsigned dy,
  94.                  unsigned sdx, unsigned sdy,
  95.                  unsigned color);
  96.          /* video to video copy */
  97. int              VESAcopy256(unsigned dx, unsigned dy,
  98.                  unsigned sx, unsigned sy,
  99.                  unsigned sdx, unsigned sdy);
  100. int              VESAcopy16(unsigned dx, unsigned dy,
  101.                 unsigned sx, unsigned sy,
  102.                 unsigned sdx, unsigned sdy);
  103.  
  104.          /* System memory to video copy */
  105. int              VESAdisp256(unsigned dx, unsigned dy,
  106.                  char *s, unsigned sw, unsigned sl,
  107.                  unsigned sx, unsigned sy,
  108.                  unsigned sdx, unsigned sdy, int direction);
  109. int              VESAdisp16(unsigned dx, unsigned dy,
  110.                 char *s, unsigned sw, unsigned sl,
  111.                 unsigned sx, unsigned sy,
  112.                 unsigned sdx, unsigned sdy);
  113.  
  114.          /* Video to System memory copy */
  115. int              VESAcapt256(char *d, unsigned dw, unsigned dl,
  116.                  unsigned dx, unsigned dy,
  117.                  unsigned sx, unsigned sy,
  118.                  unsigned sdx, unsigned sdy, int direction);
  119.  
  120. int              VESAcapt16(char *d, unsigned dw, unsigned dl,
  121.                 unsigned dx, unsigned dy,
  122.                 unsigned sx, unsigned sy,
  123.                 unsigned sdx, unsigned sdy);
  124.  
  125. #ifdef _cplusplus
  126. }
  127. #endif
  128.  
  129.  
  130.  
  131. #endif
  132.